Private Declare Function InvertRect Lib "user32" (ByVal hdc As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim lrect As RECT
Private Sub Form_Load()
DragAcceptFiles frmFastView.hwnd, True
On Error Resume Next
picGet.BorderStyle = 0
'check for command line file, load if exists
If Not Command = "" Then
Dim cmd As String
cmd = LCase$(Command)
If Right$(cmd, 4) = ".htm" Or Right$(cmd, 4) = ".css" Or Right$(cmd, 4) = ".txt" Or Right$(cmd, 4) = "html" Or Right$(cmd, 4) = ".asp" Or Right$(cmd, 4) = "shtm" Then
picImage.Top = -hScroll.Value 'scroll the verticle scroll bar
End Sub
Private Sub mnuAbout_Click()
MsgBox "FastView32 2.0 beta 2 - Copyright
1998 Take a Hike Software", vbInformation
End Sub
Private Sub mnuBGBrowse_Click()
Dialog1.CancelError = True
Dialog1.filename = ""
On Error GoTo err1
Dialog1.DialogTitle = "Open Image for Viewing"
Dialog1.Flags = &H4
Dialog1.Filter = "All Supported Formats|*.gif;*.jpg;*.bmp;*.dib;*.wmf|Gif Images (.gif)|*.gif|Jpeg Images (.jpg)|*.jpg|Bitmap Images (.bmp)|*.bmp|OS/2 or Windows DIB (*.dib)|*.dib|Windows Meta File (*.wmf)|*.wmf|All Files (*.*)|*.*"
Dialog1.FilterIndex = 1
Dialog1.ShowOpen
If Not Dialog1.filename = "" Then
Me.BackColor = &H8000000F
imgTile.Picture = imgBlank.Picture
imgTile.Picture = LoadPicture(Dialog1.filename)
FormPic = Dialog1.filename
Form_Paint
End If
Exit Sub
err1:
If Err = 32755 = True Then
MsgBox Error, vbCritical, "Invalid Picture"
End If
Resume Next
Exit Sub
End Sub
Private Sub mnuBlack_Click()
imgTile.Picture = imgBlank.Picture
Me.BackColor = &H0&
FormPic = "Nothing"
Form_Paint
End Sub
Private Sub mnuBlue_Click()
imgTile.Picture = imgBlank.Picture
Me.BackColor = &HFF0000
FormPic = "Nothing"
Form_Paint
End Sub
Private Sub mnuClearClip_Click()
Clipboard.Clear
End Sub
Private Sub mnuCopy_Click()
On Error GoTo err1
Clipboard.Clear
Clipboard.SetData picImage.Picture
Exit Sub
err1:
MsgBox Error
Resume Next
Exit Sub
End Sub
Private Sub mnuCut_Click()
On Error GoTo err1
Clipboard.Clear
Clipboard.SetData picImage.Picture
Set picImage.Picture = Nothing
Me.Height = 3290
Me.Width = 4632
Me.Caption = "FastView32"
Exit Sub
err1:
MsgBox Error
Resume Next
Exit Sub
End Sub
Private Sub mnuDelete_Click()
Set picImage.Picture = Nothing
Me.Height = 3290
Me.Width = 4635
Me.Caption = "FastView32"
End Sub
Private Sub mnuEdit_Click()
If Me.Caption = "FastView32" Then
mnuCopy.Enabled = False
mnuCut.Enabled = False
mnuFDelete.Enabled = False
mnuDelete.Enabled = False
mnuImageCode.Enabled = False
mnuNegative.Enabled = False
Else
mnuCopy.Enabled = True
mnuCut.Enabled = True
mnuDelete.Enabled = True
mnuFDelete.Enabled = True
mnuImageCode.Enabled = True
mnuNegative.Enabled = True
End If
End Sub
Private Sub mnuExit_Click()
Unload Me
End Sub
Private Sub mnuFDelete_Click()
Dim msg
msg = MsgBox("Are you sure you want to permanently delete (no recycle bin) " & Dialog1.filename & "?", vbQuestion + vbYesNo, "Are you sure?")
If msg = vbYes Then
Kill Dialog1.filename
mnuDelete_Click
End If
End Sub
Private Sub mnuFile_Click()
If Me.Caption = "FastView32" Then
mnuFDelete.Enabled = False
Else
mnuFDelete.Enabled = True
End If
If Left$(Me.Caption, 24) = "FastView32 - <Clipboard>" Then mnuFDelete.Enabled = False
Dialog1.Filter = "All Supported Formats|*.gif;*.jpg;*.bmp;*.dib;*.wmf;*.emf;*.ico;*.htm*;*.shtm*;*.asp;*.cfm;*.css;*.txt|Gif Images (.gif)|*.gif|Jpeg Images (.jpg)|*.jpg|Bitmap Images (.bmp)|*.bmp|Icons (.ico)|*.ico|OS/2 or Windows DIB (*.dib)|*.dib|Windows Meta File (*.wmf)|*.wmf|Enhanced Windows Meta File (*.emf)|*.emf|HTML and Text Files|*.htm*;*.shtm*;*.asp;*.cfm;*.css;*.txt|All Files (*.*)|*.*"
Dialog1.FilterIndex = 1
Dialog1.ShowOpen
' If it's a document open it in the HTML viewer
If Right$(Dialog1.filename, 4) = ".htm" Or Right$(Dialog1.filename, 4) = ".css" Or Right$(Dialog1.filename, 4) = ".txt" Or Right$(Dialog1.filename, 4) = "html" Or Right$(Dialog1.filename, 4) = ".asp" Or Right$(Dialog1.filename, 4) = "shtm" Then
Dialog1.Filter = "Supported Formats|*.bmp;*.wmf;*.emf;*.ico;|Bitmaps (.bmp)|*.bmp|Icons (.ico)|*.ico|Windows Meta File (.wmf)|*.wmf|Enhanced Windows Meta File (.emf)|*.emf|All Files (*.*)|*.*"
Dialog1.FilterIndex = 1
Dialog1.ShowSave
'bitmap, icon, metafile, or enhanced metafile
If Not Dialog1.filename = "" Then
Me.MousePointer = vbHourglass ' Change cursor to hourglass
SavePicture picImage.Picture, Dialog1.filename ' Save the picture
Me.MousePointer = vbDefault ' Change the cursor back to default
End If
Exit Sub
err1:
If Err = 32755 = True Then
MsgBox Error, vbCritical, "Invalid Picture"
End If
Resume Next
Exit Sub
End Sub
Private Sub mnuWhite_Click()
imgTile.Picture = imgBlank.Picture
Me.BackColor = &HFFFFFF
FormPic = "Nothing"
Form_Paint
End Sub
Private Sub mnuYellow_Click()
imgTile.Picture = imgBlank.Picture
Me.BackColor = &HFFFF&
FormPic = "Nothing"
Form_Paint
End Sub
Private Sub picSquare_KeyDown(KeyCode As Integer, Shift As Integer)
'If KeyCode = vbKeyPageUp Then
'If KeyCode = vbKeyPageDown Then
'If KeyCode = vbKeyEnd Then
'If KeyCode = vbKeyHome Then
'If KeyCode = vbKeyLeft Then
'If KeyCode = vbKeyUp Then
'If KeyCode = vbKeyRight Then
'If KeyCode = vbKeyDown Then
End Sub
Private Sub tmrOnTop_Timer()
mnuOnTop_Click
tmrOnTop.Enabled = False
End Sub
Private Sub wScroll_Change()
picImage.Left = -wScroll.Value 'scroll the horizontal scroll bar